﻿namespace RuoVea.Swms.Server.Models;

/// <summary>
/// 产品类别
/// </summary>
[SugarTable(nameof(WmsCategory), "产品类别")]
public class WmsCategory : EntityBase
{
    /// <summary>
    /// 类别名称
    /// </summary>
    [SugarColumn(ColumnDescription = "类别名称", IsNullable = false, Length = 50)]
    public string Name { get; set; }

    /// <summary>
    /// 类别编码
    /// </summary>
    [SugarColumn(ColumnDescription = "类别编码", IsNullable = false, Length = 20)]
    public string Code { get; set; }

    /// <summary>
    /// 父类别ID
    /// </summary>
    [SugarColumn(ColumnDescription = "父类别ID", IsNullable = true)]
    public long? ParentId { get; set; }

    /// <summary>
    /// 排序号
    /// </summary>
    [SugarColumn(ColumnDescription = "排序号", DefaultValue = "10")]
    public int Sort { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [SugarColumn(ColumnDescription = "备注", Length = 500)]
    public string Remark { get; set; }


    /// <summary>
    /// 子类别列表（不映射到数据库）
    /// </summary>
    [SugarColumn(IsIgnore = true)]
    public List<WmsCategory> Children { get; set; } = new List<WmsCategory>();
}
